home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / howtou_2 / messagem.bas < prev    next >
BASIC Source File  |  1999-08-28  |  4KB  |  91 lines

  1. Attribute VB_Name = "Module1"
  2. Public Message(2) As Boolean
  3. Public r2, r3, g2, g3, b2, b3 As Integer
  4. Public Sub MBox(MObj As Form, Mtxt As String, Mbut0 As String, Mbut1 As String, Mbut2 As String, Micon As Integer, Mtitle As String, MR As Integer, MG As Integer, MB As Integer, Mfont1 As String, Mfont2 As String, MposX As Integer, MposY As Integer)
  5. ' 1 = question
  6. ' 2 = info
  7. ' 3 = exlamation
  8. ' 4 = critical
  9. ' 5 = disk
  10. ' 6 = folder
  11. ' 7 = printer
  12. ' 8 = write
  13. ' 9 = trash
  14.  
  15. Message(0) = False
  16. Message(1) = False
  17. Message(2) = False
  18. With MObj
  19. r2 = MR + 50: If r2 > 255 Then r2 = 255
  20. g2 = MG + 50: If g2 > 255 Then g2 = 255
  21. b2 = MB + 50: If b2 > 255 Then b2 = 255
  22. r3 = MR - 50: If r3 < 0 Then r3 = 0
  23. g3 = MG - 50: If g3 < 0 Then g3 = 0
  24. b3 = MB - 50: If b3 < 0 Then b3 = 0
  25.  
  26. .Label2.BackColor = RGB(MR, MG, MB)
  27. .Label3.BackColor = RGB(r3, g3, b3)
  28. .Picture1.BackColor = RGB(MR, MG, MB)
  29. .Pic1(0).BackColor = RGB(MR, MG, MB)
  30. .Pic1(1).BackColor = RGB(MR, MG, MB)
  31. .Pic1(2).BackColor = RGB(MR, MG, MB)
  32. .Label1(0).BackColor = RGB(MR, MG, MB)
  33. .Label1(1).BackColor = RGB(MR, MG, MB)
  34. .Label1(2).BackColor = RGB(MR, MG, MB)
  35. .Label1(0).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  36. .Label1(1).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  37. .Label1(2).ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  38. .Label2.ForeColor = RGB(MR Xor 255, MG Xor 255, MB Xor 255)
  39. .Label3.ForeColor = RGB(r2, g2, b2)
  40. MObj.BackColor = RGB(MR, MG, MB)
  41. Dim qq As Integer
  42. For qq = 0 To 2
  43. .Label1(qq).Move 1, 1, .Pic1(qq).ScaleWidth - 2, .Pic1(qq).ScaleHeight - 2
  44. .Pic1(qq).Line (0, 0)-(.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1), RGB(r2, g2, b2), B
  45. .Pic1(qq).Line (0, .Pic1(qq).ScaleHeight - 1)-(.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1), RGB(r3, g3, b3)
  46. .Pic1(qq).Line (.Pic1(qq).ScaleWidth - 1, .Pic1(qq).ScaleHeight - 1)-(.Pic1(qq).ScaleWidth - 1, 0), RGB(r3, g3, b3)
  47. Next qq
  48. MObj.Cls
  49. .Label2.Caption = Mtxt
  50. .Label3.Font = Mfont1
  51. .Label1(0).Font = Mfont1
  52. .Label1(1).Font = Mfont1
  53. .Label1(2).Font = Mfont1
  54. .Label2.Font = Mfont2
  55. MObj.Move MposX, MposY, 4500, .Label2.Height + 1140
  56. .Label3.Move 45, 45, MObj.Width - 90, 300
  57. .Label3.Caption = "   " & Mtitle
  58. .Label1(0).Caption = Mbut0
  59. .Label1(1).Caption = Mbut1
  60. .Label1(2).Caption = Mbut2
  61. .Pic1(0).Top = MObj.Height - .Pic1(0).Height - 90
  62. .Pic1(1).Top = MObj.Height - .Pic1(0).Height - 90
  63. .Pic1(2).Top = MObj.Height - .Pic1(0).Height - 90
  64. .Picture1.Top = (MObj.Height / 2) - (.Picture1.Height / 2)
  65. .Picture1.Picture = .ImageList1.ListImages(Micon).Picture
  66. .Pic1(1).Visible = False
  67. .Pic1(2).Visible = False
  68. .Pic1(0).Left = (MObj.Width / 2) - (.Pic1(0).Width / 2)
  69.  
  70. If Mbut1 <> "" Then .Pic1(1).Visible = True
  71. If Mbut2 <> "" Then .Pic1(2).Visible = True
  72.  
  73. If Mbut1 <> "" And Mbut2 <> "" Then
  74. .Pic1(0).Left = (MObj.Width / 2) - .Pic1(0).Width - (.Pic1(1).Width / 2) - 45
  75. .Pic1(1).Left = (MObj.Width / 2) - (.Pic1(1).Width / 2)
  76. .Pic1(2).Left = (MObj.Width / 2) + (.Pic1(1).Width / 2) + 45
  77. End If
  78.  
  79. If Mbut1 <> "" And Mbut2 = "" Then
  80. .Pic1(0).Left = (MObj.Width / 2) - .Pic1(0).Width - 23
  81. .Pic1(1).Left = (MObj.Width / 2) + 23
  82. End If
  83. MObj.Line (15, 15)-(MObj.Width - 30, MObj.Height - 30), RGB(r2, g2, b2), B
  84. MObj.Line (15, MObj.Height - 30)-(MObj.Width - 30, MObj.Height - 30), RGB(r3, g3, b3)
  85. MObj.Line (MObj.Width - 30, MObj.Height - 30)-(MObj.Width - 30, 30), RGB(r3, g3, b3)
  86. MObj.Line (30, .Label3.Top + .Label3.Height)-(MObj.Width - 30, .Label3.Top + .Label3.Height), RGB(r3, g3, b3)
  87. MObj.Line (30, .Label3.Top + .Label3.Height + 15)-(MObj.Width - 30, .Label3.Top + .Label3.Height + 15), RGB(r2, g2, b2)
  88. End With
  89. MObj.Show 1
  90. End Sub
  91.